<template>
	<view class="um-form-item">
		<view class="um-form-label">{{label}}</view>
		<view class="um-form-input">
			<slot></slot>
		</view>
		<um-icon name="arrowright" :size="24" v-if="arrow"></um-icon>
	</view>
</template>

<script lang="ts" setup>
	import { provide } from 'vue';

	const props = withDefaults(defineProps<{ arrow ?: boolean, label ?: string }>(), {
		arrow: false
	})

	provide('formItemProps', props)
</script>

<style lang="scss" scoped>
	.um-form-item {
		display: flex;
		align-items: center
	}

	.um-form-input {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}
</style>